home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / include / plstubs.h < prev    next >
C/C++ Source or Header  |  1996-05-10  |  8KB  |  245 lines

  1. /* $Id: plstubs.h,v 1.22 1994/07/20 06:07:44 mjl Exp $
  2.  * $Log: plstubs.h,v $
  3.  * Revision 1.22  1994/07/20  06:07:44  mjl
  4.  * Added definitions for Fortran interface routines to handle the new 3d
  5.  * functions plline3(), plpoin3(), and plpoly3().
  6.  *
  7.  * Revision 1.21  1994/03/23  07:11:49  mjl
  8.  * Added stub name definitions for cmap1 selectors and plshade front-ends.
  9. */
  10.  
  11. /*
  12.    plstubs.h
  13.  
  14.    Maurice LeBrun
  15.    IFS, University of Texas
  16.  
  17.    Header file for plplot Fortran interface stubs.
  18.    THIS FILE IS NOT FOR INCLUSION BY USER CODES!!
  19.  
  20.    The contents of this file are in the public domain.
  21. */
  22.  
  23. #ifndef __PLSTUBS_H__
  24. #define __PLSTUBS_H__
  25.  
  26. #include "plplotP.h"
  27.  
  28. /*----------------------------------------------------------------------*\
  29.  * Select name transformation based on system type.
  30.  *
  31.  * Define the STUB_LINKAGE flag to get proper C<->Fortran linkage on your
  32.  * system.  This flag describes what the compiler does to Fortran routine
  33.  * names, which we must duplicate on the C stubs so that the Fortran
  34.  * routines may call them.  You can often set STUB_LINKAGE by the
  35.  * construct -DSTUB_LINKAGE=<value> on the C compiler command line, but
  36.  * it is best to either rely on the default or explicitly handle your
  37.  * system below.
  38.  *
  39.  * Current choices for STUB_LINKAGE:
  40.  *
  41.  *     STUB_LAU    lower-case, append underscore
  42.  *     STUB_L        lower-case
  43.  *    STUB_U        upper-case
  44.  *    STUB_FORTRAN    use "fortran" keyword (MS-DOS convention)
  45.  *
  46.  * If no choice is made, the default is set to STUB_LAU.  This should
  47.  * handle most generic Unix boxes not already accounted for.
  48.  *
  49.  * ** Namespace collision **
  50.  *
  51.  * If you use the STUB_L option, the C & Fortran namespaces will collide
  52.  * if the Fortran compiler does lower case folding (they usually do).
  53.  * The problem is then that the stub names and actual function names will
  54.  * be exactly the same, if we insist on the Fortran and C bindings to be
  55.  * similar.  The solution is to give the externally callable C routines
  56.  * unique names, and provide macros to turn the documented entry names in
  57.  * to the real ones.  This is a horrible kludge, but the alternatives are
  58.  * worse.  Fortunately it has no effect on the user program, and you can
  59.  * forget that you ever read about it here.
  60. \*----------------------------------------------------------------------*/
  61.  
  62. #define STUB_LAU    1
  63. #define STUB_L        2
  64. #define STUB_U        3
  65. #define STUB_FORTRAN    4
  66.  
  67. #ifndef STUB_LINKAGE
  68.  
  69. #if defined(SX)                /* NEC Super-UX (SX-3) */
  70. #define STUB_LINKAGE STUB_LAU
  71. #endif
  72.  
  73. #if defined(_IBMR2) && defined(_AIX)    /* AIX */
  74. #define STUB_LINKAGE STUB_L
  75. #endif
  76.  
  77. #ifdef __hpux                /* HP/UX */
  78. #define STUB_LINKAGE STUB_L
  79. #endif
  80.  
  81. #ifdef __mips                /* IRIX (SGI systems) */
  82. #define STUB_LINKAGE STUB_LAU
  83. #endif
  84.  
  85. #ifdef sun                /* Suns */
  86. #define STUB_LINKAGE STUB_LAU
  87. #endif
  88.  
  89. #ifdef CRAY                /* Cray/UNICOS */
  90. #define STUB_LINKAGE STUB_U
  91. #endif
  92.  
  93. #if defined(__alpha) && defined(__osf__) /* DEC Alpha AXP/OSF */
  94. #define STUB_LINKAGE STUB_LAU
  95. #endif
  96.  
  97. #ifdef __GO32__                /* dos386/djgpp */
  98. #ifdef MSDOS
  99. #undef MSDOS
  100. #endif
  101. #endif
  102.  
  103. #ifdef MSDOS                /* MS-DOS based */
  104. #define STUB_LINKAGE STUB_FORTRAN
  105. #endif
  106.  
  107. #ifdef __riscos
  108. #define STUB_LINKAGE STUB_U
  109. #endif
  110.  
  111. #ifndef STUB_LINKAGE            /* The default */
  112. #define STUB_LINKAGE STUB_LAU
  113. #endif
  114.  
  115. #endif    /* ifndef STUB_LINKAGE */
  116.  
  117. /*----------------------------------------------------------------------*\
  118.  * Define name-translation macro.
  119.  * To use, define with x the upper case routine name, y the lower case.
  120.  * Should be adoptable to virtually any system.
  121. \*----------------------------------------------------------------------*/
  122.  
  123. #if STUB_LINKAGE==STUB_LAU
  124. #define FNAME(x,y)    y##_
  125.  
  126. #elif STUB_LINKAGE == STUB_L
  127. #define FNAME(x,y)    y
  128.  
  129. #elif STUB_LINKAGE == STUB_U
  130. #define FNAME(x,y)    x
  131.  
  132. #elif STUB_LINKAGE == STUB_FORTRAN
  133. #define FNAME(x,y)    fortran x
  134.  
  135. #else
  136. #error "Illegal setting for STUB_LINKAGE"
  137. #endif
  138.  
  139. /*----------------------------------------------------------------------*\
  140.  * Now to actually define the stub names.
  141.  * Each stub must have an entry here.
  142. \*----------------------------------------------------------------------*/
  143.  
  144. #define    PLADV    FNAME(PLADV,pladv)
  145. #define    PLAXES7    FNAME(PLAXES7,plaxes7)
  146. #define    PLBIN    FNAME(PLBIN,plbin)
  147. #define    PLBOP    FNAME(PLBOP,plbop)
  148. #define    PLBOX    FNAME(PLBOX,plbox)
  149. #define    PLBOX37    FNAME(PLBOX37,plbox37)
  150. #define    PLBOX7    FNAME(PLBOX7,plbox7)
  151. #define    PLCLR    FNAME(PLCLR,plclr)
  152. #define    PLCOL    FNAME(PLCOL,plcol)
  153. #define    PLCOL0    FNAME(PLCOL0,plcol0)
  154. #define    PLCOL1    FNAME(PLCOL1,plcol1)
  155. #define    PLCON07    FNAME(PLCON07,plcon07)
  156. #define    PLCON17    FNAME(PLCON17,plcon17)
  157. #define    PLCON27    FNAME(PLCON27,plcon27)
  158. #define    PLCONT7    FNAME(PLCONT7,plcont7)
  159. #define    PLEND    FNAME(PLEND,plend)
  160. #define    PLEND1    FNAME(PLEND1,plend1)
  161. #define    PLENV    FNAME(PLENV,plenv)
  162. #define    PLEOP    FNAME(PLEOP,pleop)
  163. #define    PLERRX    FNAME(PLERRX,plerrx)
  164. #define    PLERRY    FNAME(PLERRY,plerry)
  165. #define    PLFAMADV    FNAME(PLFAMADV,plfamadv)
  166. #define    PLFILL    FNAME(PLFILL,plfill)
  167. #define    PLFLUSH    FNAME(PLFLUSH,plflush)
  168. #define    PLFONT    FNAME(PLFONT,plfont)
  169. #define    PLFONTLD    FNAME(PLFONTLD,plfontld)
  170. #define    PLGCHR    FNAME(PLGCHR,plgchr)
  171. #define    PLGFAM    FNAME(PLGFAM,plgfam)
  172. #define    PLGFNAM7    FNAME(PLGFNAM7,plgfnam7)
  173. #define    PLGPAGE    FNAME(PLGPAGE,plgpage)
  174. #define    PLGRA    FNAME(PLGRA,plgra)
  175. #define    PLGSPA    FNAME(PLGSPA,plgspa)
  176. #define    PLGSTRM    FNAME(PLGSTRM,plgstrm)
  177. #define    PLGVER    FNAME(PLGVER,plgver)
  178. #define    PLGVER7    FNAME(PLGVER7,plgver7)
  179. #define    PLGXAX    FNAME(PLGXAX,plgxax)
  180. #define    PLGYAX    FNAME(PLGYAX,plgyax)
  181. #define    PLGZAX    FNAME(PLGZAX,plgzax)
  182. #define    PLHIST    FNAME(PLHIST,plhist)
  183. #define    PLHLS        FNAME(PLHLS,plhls)
  184. #define    PLINIT       FNAME(PLINIT,plinit)
  185. #define    PLJOIN    FNAME(PLJOIN,pljoin)
  186. #define    PLLAB    FNAME(PLLAB,pllab)
  187. #define    PLLAB7    FNAME(PLLAB7,pllab7)
  188. #define    PLLINE    FNAME(PLLINE,plline)
  189. #define    PLLINE3    FNAME(PLLINE3,plline3)
  190. #define    PLLSTY    FNAME(PLLSTY,pllsty)
  191. #define    PLMESH    FNAME(PLMESH,plmesh)
  192. #define    PLMTEX7    FNAME(PLMTEX7,plmtex7)
  193. #define    PLOT3D    FNAME(PLOT3D,plot3d)
  194. #define    PLPAT    FNAME(PLPAT,plpat)
  195. #define    PLPOIN    FNAME(PLPOIN,plpoin)
  196. #define    PLPOIN3    FNAME(PLPOIN3,plpoin3)
  197. #define    PLPOLY3    FNAME(PLPOLY3,plpoly3)
  198. #define    PLPREC    FNAME(PLPREC,plprec)
  199. #define    PLPSTY    FNAME(PLPSTY,plpsty)
  200. #define    PLPTEX7    FNAME(PLPTEX7,plptex7)
  201. #define    PLRGB        FNAME(PLRGB,plrgb)
  202. #define    PLRGB1    FNAME(PLRGB1,plrgb1)
  203. #define    PLSASP       FNAME(PLSASP,plsasp)
  204. #define    PLSCHR    FNAME(PLSCHR,plschr)
  205. #define    PLSCMAP0    FNAME(PLSCMAP0,plscmap0)
  206. #define    PLSCMAP1    FNAME(PLSCMAP1,plscmap1)
  207. #define    PLSCMAP0N    FNAME(PLSCMAP0N,plscmap0n)
  208. #define    PLSCMAP1L    FNAME(PLSCMAP1L,plscmap1l)
  209. #define    PLSCOL0    FNAME(PLSCOL0,plscol0)
  210. #define    PLSCOLBG    FNAME(PLSCOLBG,plscolbg)
  211. #define    PLSCOLOR    FNAME(PLSCOLOR,plscolor)
  212. #define    PLSDEV7    FNAME(PLSDEV7,plsdev7)
  213. #define    PLSESC    FNAME(PLSESC,plsesc)
  214. #define    PLSFAM    FNAME(PLSFAM,plsfam)
  215. #define    PLSFNAM7    FNAME(PLSFNAM7,plsfnam7)
  216. #define    PLSHADE07    FNAME(PLSHADE07,plshade07)
  217. #define    PLSHADE17    FNAME(PLSHADE17,plshade17)
  218. #define    PLSHADE27    FNAME(PLSHADE27,plshade27)
  219. #define    PLSMAJ    FNAME(PLSMAJ,plsmaj)
  220. #define    PLSMIN    FNAME(PLSMIN,plsmin)
  221. #define    PLSORI    FNAME(PLSORI,plsori)
  222. #define    PLSPAGE    FNAME(PLSPAGE,plspage)
  223. #define    PLSPAUSE    FNAME(PLSPAUSE,plspause)
  224. #define    PLSSTRM    FNAME(PLSSTRM,plsstrm)
  225. #define    PLSSUB    FNAME(PLSSUB,plssub)
  226. #define    PLSSYM    FNAME(PLSSYM,plssym)
  227. #define    PLSTAR    FNAME(PLSTAR,plstar)
  228. #define    PLSTART7    FNAME(PLSTART7,plstart7)
  229. #define    PLSTYL    FNAME(PLSTYL,plstyl)
  230. #define    PLSVPA    FNAME(PLSVPA,plsvpa)
  231. #define    PLSXAX    FNAME(PLSXAX,plsxax)
  232. #define    PLSYAX    FNAME(PLSYAX,plsyax)
  233. #define    PLSYM    FNAME(PLSYM,plsym)
  234. #define    PLSZAX    FNAME(PLSZAX,plszax)
  235. #define    PLTEXT    FNAME(PLTEXT,pltext)
  236. #define    PLVASP    FNAME(PLVASP,plvasp)
  237. #define    PLVPAS    FNAME(PLVPAS,plvpas)
  238. #define    PLVPOR    FNAME(PLVPOR,plvpor)
  239. #define    PLVSTA    FNAME(PLVSTA,plvsta)
  240. #define    PLW3D    FNAME(PLW3D,plw3d)
  241. #define    PLWID    FNAME(PLWID,plwid)
  242. #define    PLWIND    FNAME(PLWIND,plwind)
  243.  
  244. #endif    /* __PLSTUBS_H__ */
  245.